<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/26
  Time: 19:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>查询所有产品登记</title>
</head>
<body>
        <div>
            <table id="produktionsregistrierungqueryalltab">

            </table>
        </div>
        <script>
            //加载表格数据
            $("#produktionsregistrierungqueryalltab").bootstrapTable({
                url:"queryBymmanfactureAll.action",
                method:'get',                      //请求方式（*）
                contentType:"application/x-www-form-urlencoded", //如果用tomcat就要写这个
                toolbar:"#queryallcellshowtabs ",//工具按件用那个容器
                striped: true,//是否显示隔行变色
                cache: false,//是否缓存
                pagination: true,//是否显示分页
                sortable: true,//是否显示排序
                sortOrder: "aso",//排序方式
                sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,//初始化加载第一页，默认第一页,并记录
                pageSize: 5,//每页记录数
                pageList: [5, 10, 15, 20],//可供选择的每页的行数（*）
                search: false,//是否显示输入框
                strictSearch: true,
                showColumns: true,//是否显示所有的列（选择显示的列）
                showRefresh: true,//是否显示刷新按钮
                minimumCountColumns: 2,//最少允许的列数
                clickToSelect: true,//是否启用点击选中行
                uniqueId:"productid",//每一行的唯一标识，一般为主键列
                showToggle: true,//是否显示详细视图和列表视图的切换按钮
                cardView: false,//是否显示详细视图
                detailView: false,//是否显示父子表
                //获取查询到的参数
                queryParams: function (params) {
                    var cellss={
                        pagesize:params.limit,
                        pageno:(params.offset/params.limit)+1,
                        sort:params.sort,
                        sortOrder:params.sort,
                        productName:$("#productNameCellByNames").val(),
                    }
                    return cellss;
                },
                columns:[
                    {
                        field:"manufactureId",
                        title:"派工单编号",
                    },
                    {
                        field:"productId",
                        title:"产品编号",
                    },
                    {
                        field:"productName",
                        title:"产品名称",
                    },
                    {
                        field:"amount",
                        title:"数量",
                    },
                    {
                        field:"testedAmount",
                        title:"合格产品数量",
                        formatter:function (vlaue,row,index) {
                            if(row.checkTag=="S001-0"){
                                return "<span  class=\"label label-warning\">生产中</span>"
                            }
                            if(row.checkTag=="S001-1"){
                                return "<span  class='label label-success'>生产中</span>"
                            }
                            if(row.manufactureProcedureTag=="S002-2"){
                                 return  row.testedAmount;
                            }
                        }
                    },
                    {
                        field:"checkTag",
                        title:"派工单状态",
                        formatter:function (vlaue,row,index) {
                             if(row.checkTag=="S001-0"){
                                return "<span  class='label label-warning'>等待</span>"
                            }
                            if(row.checkTag=="S001-1"){
                                return "<span  class='label label-success'>生产中</span>"
                            }
                            if(row.manufactureProcedureTag=="S002-2"){
                                return "<span  class='label label-info'>完成</span>"
                            }
                        }
                    },
                    {
                        field:"manufactureProcedureTag",
                        title:"生产状态",
                        formatter:function (vlaue,row,index) {
                            if(row.manufactureProcedureTag=="S002-0"){
                                return "<span  class='label label-warning'>等待</span>"
                            }
                            if(row.manufactureProcedureTag=="S002-1"){
                                return "<span  class='label label-success'>生产中</span>"
                            }
                            if(row.manufactureProcedureTag=="S002-2"){
                                return "<span  class='label label-info'>完成</span>"
                            }
                        }
                    }

                ]
            })
        </script>
</body>
</html>
